package com.pajk.user.exception;

/**
 * Base exception for all user service exceptions.
 *
 * Currently defined/known exception codes:
 *  - EntityNotFoundException | E0001
 *  - InternalSystemErrorException | E0002
 *  - UniqueAccountPerChannelViolationException | E0003
 *  - UniqueKeyViolationException | E0004
 *
 * @author Haomin Liu, Sean Gao
 */
public class UserServiceException extends RuntimeException {

    protected String exceptionCode = "E0000";

    public String getExceptionCode() {
        return exceptionCode;
    }

    public UserServiceException() {
        super();
    }

    public UserServiceException(String message) {
        super(message);
    }

    public UserServiceException(String message, String exceptionCode) {
        super(message);
        this.exceptionCode = exceptionCode;
    }

    public UserServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public UserServiceException(String message, Throwable cause, String exceptionCode) {
        super(message, cause);
        this.exceptionCode = exceptionCode;
    }

    public UserServiceException(Throwable cause) {
        super(cause);
    }

    public UserServiceException(Throwable cause, String exceptionCode) {
        super(cause);
        this.exceptionCode = exceptionCode;
    }

}
